import request from '@utils/request'

// 请求列表数据
const fetchArtList = (params = {}) => request.get('/api/getItemsList', { params })

// 添加商品数据
const addItem = (params = {}) => request.post('/api/addItem', params)

// 获取单个商品数据
const getItem = (id) => request.get('/api/getItem', {
  params: {
    id
  }
})

// 更新商品数据
const updataItem = (params = {}) => request.post('/api/updateItem', params)

// 删除商品
const delItem = (id) => request.get('/api/delItem', {
  params: {
    id
  }
})

// 登录接口
const isLogin = (params = {}) => request.post('/api/login', params)

export {
  fetchArtList,
  addItem,
  getItem,
  updataItem,
  delItem,
  isLogin
}
